<?php
namespace app\api\model\sms;
use think\Model;
use think\facade\Db;
use app\api\common;
class Sms extends Model {
	private $table_obj;
	
	public function getSetting($where,$field='*'){
		extract(common::get('sms',[$where,$field]));
		if(empty($data)){
			$data=Db::name("sms")->where('id','>',0)->field($field)->find();
			common::set($data);
		}
		return $data;
	}
	/**
	 *
	 * 存储数据 
	 */
	
	public function setting_insert($data_insert){
		common::delete("sms");
		return Db::name('sms')->strict(false)->insert($data_insert);
		
	}
	/**
	 * 更新
	 * 
	 */
	public function setting_update($up,$where){
		common::delete("sms");
		return Db::name('sms')
		    ->where($where)
		    ->update($up);
	}
}
?>